﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<BGCMS.Models.ChildViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Tímalína barns
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="leftside">
        <h2>
            Barnið mitt</h2>
        <ul>
            <li>
                <%: Html.ActionLink("Skrá barn", "CreateChild", "Child") %></li>
            <li>
                <%: Html.ActionLink("Breyta barni", "EditChild", new { id = Model.Child.ID}) %></li>
            <li>
                <%: Html.ActionLink("Tímalína barns", "Child", new { id = Model.Child.ID })%></li>
            <li>
                <%: Html.ActionLink("Heilsufarsskrá", "HealthLog", new { id = Model.Child.ID })%></li>
            <li>
                <%: Html.ActionLink("Bólusetningar", "VaccinationLog", new { id = Model.Child.ID })%></li>
            <li>
                <%: Html.ActionLink("Tímapantanir", "AppointmentLog", new { id = Model.Child.ID })%></li>
            <li>
                <%: Html.ActionLink("WHO kúrva","Graph","Home") %></li>
        </ul>
    </div>
    <div id="content">
        <h2>
            Tímalína barns</h2>
        <h3>
            <%: Model.Child.Name %>
            er
            <%: Model.AgeInWeeks %>
            vikna</h3>
        <div id="appointments">
            <% if (Model.Appointments.Count() != 0)
               { %>
            <table class="tafla">
                <caption>
                    Tímapantanir á næstunni</caption>
                <thead>
                    <tr>
                        <th>
                            Tímasetning
                        </th>
                        <th>
                            Staður
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <% foreach (var a in Model.Appointments)
                       { %>
                    <tr>
                        <td>
                            <%: a.AppointmentTime.ToString("dd/MM/yyyy H:mm") %>
                        </td>
                        <td>
                            <%: a.TextBody %>
                        </td>
                    </tr>
                    <% } %>
                </tbody>
            </table>
            <% } %>
        </div>
        <div id="timeline">
            <p>
                Settu músabendilinn yfir þá viku sem þú villt fá nánari upplýsingar um.<br />
                Ef ekkert birtist hafa engar upplýsingar verið skráðar fyrir tiltekna viku</p>
            <ul>
                <% for (int i = 0; i <= Model.AgeInWeeks; i++)
                   { %>
                <li onmouseover="getTimeline(<%: Model.Child.ID %>,<%: i %>)">Vika
                    <%: i %>
                </li>
                <% } %>
            </ul>
            <table id="healthlog">
                <caption>
                    Mælingar í vikunni</caption>
                <thead>
                    <tr>
                        <th>
                            Dagsetning
                        </th>
                        <th>
                            Þyngd (kg)
                        </th>
                        <th>
                            Hæð (cm)
                        </th>
                        <th>
                            Ummál höfuðs (cm)
                        </th>
                        <th>
                            Athugasemdir
                        </th>
                    </tr>
                </thead>
                <tbody id="healthData">
                </tbody>
            </table>
        </div>
    </div>
    <script id="healthTemplate" type="text/html">
        <tr>
            <td>${DateOfCheck}</td>
            <td>${Weight}</td>
            <td>${Height}</td>
            <td>${HeadCircumreference}</td>
            <td>${Comments}</td>
        </tr>
    </script>
</asp:Content>